function [res, timeElapsed, resAIO] = RMKKM_single_dataset(Ks, Y, gammas, nRepeat )
[nSmp, ~, nKernel] = size(Ks);
nCluster = length(unique(Y));
if ~exist('nRepeat', 'var')
    nRepeat = 1;
end

if ~exist('gammas', 'var')
    gammas = [0.1:0.1:0.9];
end

KsCell = cell(1, nKernel);
for i1 = 1:nKernel
    KsCell{i1} = Ks(:,:,i1);
end
clear Ks;

tic;
resAIO = zeros(length(gammas), 3);
for i2 = 1:length(gammas)
    gamma = gammas(i2);
    disp(['gamma= ', num2str(gamma)]);
    res_rmkkm = [];
    for i1 = 1:1
        [label_rmkkm, kw, ~, ~, obj] = RMKKM(KsCell, nCluster, 'gamma', gamma, 'maxiter', 100, 'replicates', 50);
        res_rmkkm = [res_rmkkm; ClusteringMeasure(Y, label_rmkkm)];%#ok<AGROW>
    end
    resAIO(i2,:) = mean(res_rmkkm, 1);
end
res = max(resAIO, [], 1);
timeElapsed = toc;